package cn.gailvlun.gll.bean;

import java.util.ArrayList;
import java.util.List;



public class SelectHolder<T> {

    public SelectHolder(T data, Boolean isSelected) {
        this.data = data;
        this.isSelected = isSelected;
    }

    private T data;
    private Boolean isSelected;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Boolean getSelected() {
        return isSelected;
    }

    public void setSelected(Boolean selected) {
        isSelected = selected;
    }

    public static <T> SelectHolder<T> transform(T t) {
        return new SelectHolder<>(t, false);
    }

    public static <T> List<SelectHolder<T>> transform(List<T> list) {
        ArrayList<SelectHolder<T>> arrayList = new ArrayList<>();
        for (T t : list) {
            arrayList.add(transform(t));
        }
        return arrayList;
    }
}
